<template>
  <div>
    <div>home:{{ name }}</div>
    <div>
      <router-link :to="{name:'Test'}">test223</router-link>
    </div>
    <div>
      <img :src="dogPic" class="dog-img">
    </div>
  </div>
</template>
<script>
import { getHomeData } from '@/api/home'
import dogPic from '@/asset/dog.jpg'
export default {
  async asyncData({ store, route }) {
    var data = {}
    try {
      data = await getHomeData({})
      store.dispatch('fetchName', data.car_info.model_num)
    } catch (exp) {
      // console.log({ exp })
    }
    // console.log({ data })
    return data
  },
  name: 'Hello',
  data() {
    return {
      dogPic
    }
  },
  computed: {
    name() {
      return this.$store.state.name
    }
  }
}
</script>
<style lang="scss" scoped>
.dog-img{
  width:300px;
}
</style>

